A Public Domain Application/ShareWare Source Code program written in LightSpeed Pascal.
The source code of the application can be modified and used like a 'shell' program with many user interface features already present and worked out for the programmer.
To obtain the latest version ShareWare source code for this applicaton, written in LightSpeed Pascal send $5, along with a self addressed/stamped envelope and 400K/800K disk to:
Stephen Scandalis
1414 Prince Edward Way
Sunnyvale, CA 94087
All commercial rights for this application are reserved by the author, but the ShareWare source code may be modified for another application without any further claims from this author.
TEXT CONVERT is a simple application which converts line endings of text file to types required by either the Macintosh or IBM PC computers.
It is the outgrowth of needing to transfer text back and forth from my work, where we use MS-DOS machines, to home where of course a Mac sits.
It has also been the method by which I have learned much about programming the Macintosh computer.
The text editors for several MS-DOS editors require either a CR/LF or just LF line ending. WIth one particular editor I use, DFEdit, the lack of a LF results in a file which cannot be edited. When the file is opened only the last line shows.
The Mac, on the other hand, doesn't like to see LF characters. If it does you end up seeing a 'ยท' on the screen.
Below is a chart of the line endings each machine requires.
ALLOWED INPUT OUTPUT
Macintosh CR only CR only
IBM CR & LF CR & LF
or or
LF only LF only
As can been seen you need to convert the line endings to sucessfully use text files from one machine to another, therefore TEXT CONVERT.
Much more important than the application is the experience this program has provided for learning how to program the Mac.
With the fully commented source code I've provided for many of the difficult to learn features of programming the Macintosh. A partial list is given below:
1) Using UNITS in LightSpeed Pascal to break the code into modules. Smaller
modules are easier to maintain. The present program is broken into 4 UNITS
and uses a 'resource' file to hold menu, dialog and alter information.
2) Segmentation of code in LightSpeed Pascal to allow for larger programs than
32K. Within the LightSpeed environment the application much be split into
two segments to run.
3) Growing, Zooming and moving a window.
4) Multiple window management.
5) Saving a picture of QuickDraw commands for a drawing window, so the system
will automatically update the window's picture when resized or obscured by a
dialog or alert box.
Utilities included are:
procedure StartPic; {start saving QuickDraw format of window into a picture}
procedure StopPic; {stop saving into a picture record}
I hope you find the application usefull. Contact me at the above address to purchase the ShareWare source code in LightSpeed Pascal.
Armed with this source code a begining programmer should be able to strip 'Text Convert' specific code out and insert their own application specific code. As an example of the amount of code needed to actually do the text conversion, only about 100-200 lines of code and comments are actually devoted to conversion, the rest of the approximately 2000 lines of code implements the Macintosh user interface.